#ifndef _CTILELAYER_H
#define _CTILELAYER_H

#include "CTexture.h"

class CTiledLayer
{
public:

			 CTiledLayer(CTexture *pImage, int column, int row, int cellSize);
	virtual ~CTiledLayer();

	void	Draw(RECT rect, int angle);
	BOOL	IsCollision(int x, int y, int width, int height);
	void	SetCell(int column, int row, int index);

private:

	void	DrawCell(int index, int x, int y, int angle);

	CTexture *m_pImage;
	int		**m_ppMap;
	D3DXMATRIX mtxTransform;

	int m_iColumn;
	int m_iRow;
	int m_iCellSize;
	int m_iNumCellWidth;
	int m_iNumCellHeight;
	int m_iNumFrame;
	int m_iNumFrameInRow;
};



#endif